#include <QApplication>
#include "CMainWindow.h"
#include "CSettings.h"
#include <QFont>
#include "CConversion.h"
#include <QDebug>
#include "CUIHelper.h"
#include "CIconFont.h"

int main(int argc, char *argv[])
{

#if(QT_VERSION >= QT_VERSION_CHECK(5,6,0))
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif

    QApplication a(argc, argv);

    QFont font;
    font.setFamily("等线,Arial");
    a.setFont(font);

    CSettings::getInstance()->init();
    CIconFont::getInstance()->init(":/Font/iconfont.ttf");
//    CUIHelper::installQss(QString(PRO_DIR) + "/style.qss");

    CMainWindow::getInstance()->resize(800,800);
    CMainWindow::getInstance()->show();

//    char *strText = "12345678";

//    int nVal;
//    nVal = CConversion::crc8((const unsigned char *)strText,strlen(strText));
//    qDebug("CRC 8:%x",nVal);

//    nVal = CConversion::crc16((const unsigned char *)strText,strlen(strText));
//    qDebug("CRC 16:%x",nVal);

//    nVal = CConversion::crc16MODBUS((const unsigned char *)strText,strlen(strText));
//    qDebug("CRC 16MODBUS:%x",nVal);

//    nVal = CConversion::crc16DNP((const unsigned char *)strText,strlen(strText));
//    qDebug("CRC 16DNP:%x",nVal);


    return a.exec();
}
